using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class RioSMSHistoryMap : EntityTypeConfiguration<RioSMSHistory>
    {
        public RioSMSHistoryMap()
        {
            // Primary Key
            this.HasKey(t => t.RioUserId);

            // Properties
            this.Property(t => t.RioUserId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.SMSCode)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("RioSMSHistory");
            this.Property(t => t.RioUserId).HasColumnName("RioUserId");
            this.Property(t => t.SMSType).HasColumnName("SMSType");
            this.Property(t => t.SMSCode).HasColumnName("SMSCode");
            this.Property(t => t.CreatedDate).HasColumnName("CreatedDate");
            this.Property(t => t.UpdatedDate).HasColumnName("UpdatedDate");
        }
    }
}
